<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量，数据类型</title>
    <script>
        var i = "100";
        var j = 100;

        // console.log(i + j);
        function fun() {
            console.log(document.getElementById("h1h").innerHTML);
        }

        // 数组
        var cars = new Array();
        // cars[2] = 22;
        // cars[4] = 'a';
        // console.log(cars)
        // cars.reverse()
        // console.log(cars)

        // js object
        // var person={firstname:"Bill", lastname:"Gates", id:5566};
        // console.log(person.firstname)

        var person = {firstname:"Bill", lastname:"Gates", jump: function (arg) {alert(arg)}, id:5566}
        console.log(person)
        person.username = "jack";
        person.gender = "男";
        console.log(person)

        person.jump("你跳吧！")

        car = function () {
            this.typessss= 11111;
        }


        //有返回值的函数，用return返回
        function add(arg01, arg02) {
            let i = 100;
            return arg01 + arg02;
        }

        var arr = [1, 2, 3, 4, 5]

        console.log('===================>')
        for (item in arr) {
            console.log(item)
        }
        try {

        } catch (dddd) {
            console.error(dddd)
        }
    </script>
</head>
<body onload="fun()">
<!--<img src="bababa.jpg" alt="不用好奇，只是一个图片而已">-->
<h1 id="h1h"><span>这是h1中的内容s</span></h1>

<input type="button" onclick="alert(add02(3, 9))"/>
</body>
</html>